﻿using System;

using Fuse8.DomainFramework.Domain;

namespace Fuse8.DomainFramework.DataAccess
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TEntity"></typeparam>
    /// <typeparam name="TRepository"></typeparam>
    public interface IEntityDataRepositoryMapper<TEntity, TRepository>
        where TEntity : class, IEntityObject
        where TRepository : class
    {   
        /// <summary>
        /// 
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="repositoryEntity"></param>
        void ToRepositoryEntity(TEntity entity, TRepository repositoryEntity);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="repositoryEntity"></param>
        /// <param name="entity"></param>
        void FromRepositoryEntity(TRepository repositoryEntity, TEntity entity);

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        TEntity CreateEntity();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        TRepository CreateRepositoryEntity();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="repositoryEntity"></param>
        /// <param name="entity"></param>
        void SetIdentityField(TRepository repositoryEntity, TEntity entity);
    }
}
